Merge "Add meta=userinfo&uiprop=latestcontrib"
[lhc/web/wiklou.git] / maintenance / storage / checkStorage.php
index 0ec24af..26d4e79 100644 (file)
@@ -29,11 +29,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 
        $cs = new CheckStorage;
        $fix = isset( $options['fix'] );
-       if ( isset( $args[0] ) ) {
-               $xml = $args[0];
-       } else {
-               $xml = false;
-       }
+       $xml = $args[0] ?? false;
        $cs->check( $fix, $xml );
 }
 
@@ -90,7 +86,6 @@ class CheckStorage {
                        foreach ( $res as $row ) {
                                $this->oldIdMap[$row->rev_id] = $row->rev_text_id;
                        }
-                       $dbr->freeResult( $res );
 
                        if ( !count( $this->oldIdMap ) ) {
                                continue;
@@ -151,7 +146,6 @@ class CheckStorage {
                                        $this->addError( 'unfixable', "Error: invalid flags field \"$flags\"", $id );
                                }
                        }
-                       $dbr->freeResult( $res );
 
                        // Output errors for any missing text rows
                        foreach ( $missingTextRows as $oldId => $revId ) {
@@ -191,7 +185,6 @@ class CheckStorage {
                                                $externalNormalBlobs[$cluster][$id][] = $row->old_id;
                                        }
                                }
-                               $dbr->freeResult( $res );
                        }
 
                        // Check external concat blobs for the right header
@@ -214,7 +207,6 @@ class CheckStorage {
                                        foreach ( $res as $row ) {
                                                unset( $xBlobIds[$row->blob_id] );
                                        }
-                                       $extDb->freeResult( $res );
                                        // Print errors for missing blobs rows
                                        foreach ( $xBlobIds as $blobId => $oldId ) {
                                                $this->addError(
@@ -266,12 +258,12 @@ class CheckStorage {
                                                case 'historyblobcurstub':
                                                        if ( strlen( $row->header ) == $headerLength ) {
                                                                $this->addError( 'unfixable', "Error: overlong stub header", $oldId );
-                                                               continue;
+                                                               break;
                                                        }
                                                        $stubObj = unserialize( $row->header );
                                                        if ( !is_object( $stubObj ) ) {
                                                                $this->addError( 'restore text', "Error: unable to unserialize stub object", $oldId );
-                                                               continue;
+                                                               break;
                                                        }
                                                        if ( $className == 'historyblobstub' ) {
                                                                $concatBlobs[$stubObj->mOldId][] = $oldId;
@@ -283,7 +275,6 @@ class CheckStorage {
                                                        $this->addError( 'unfixable', "Error: unrecognised object class \"$className\"", $oldId );
                                        }
                                }
-                               $dbr->freeResult( $res );
                        }
 
                        // Check local concat blob validity
@@ -337,7 +328,6 @@ class CheckStorage {
 
                                        unset( $concatBlobs[$row->old_id] );
                                }
-                               $dbr->freeResult( $res );
                        }
 
                        // Check targets of unresolved stubs
@@ -425,7 +415,6 @@ class CheckStorage {
                                }
                                unset( $oldIds[$row->blob_id] );
                        }
-                       $extDb->freeResult( $res );
 
                        // Print errors for missing blobs rows
                        foreach ( $oldIds as $blobId => $oldIds2 ) {